package com.elong.businesstravel.protocol.unionlogin;

import org.apache.http.Header;
import org.json.JSONObject;

import com.elong.businesstravel.entitys.WeChatUserInfo;
import com.elong.businesstravel.protocol.baseresponse.BaseELongJsonHttpResponse;
import com.elong.businesstravel.protocol.baseresponse.BaseWeChatJsonHttpResponse;

public class GetWeiXinUserInfoResponse extends BaseWeChatJsonHttpResponse {

	protected WeChatUserInfo weChatUserInfo = new WeChatUserInfo();
	
	@Override
	public void onSuccess(int statusCode, Header[] headers,
			JSONObject mainJsonObject) throws Throwable {
		weChatUserInfo.openid = mainJsonObject.optString("openid", "");
		weChatUserInfo.nickname = mainJsonObject.optString("nickname", "");
		weChatUserInfo.sex = mainJsonObject.optString("sex", "");
		weChatUserInfo.province = mainJsonObject.optString("province", "");
		weChatUserInfo.city = mainJsonObject.optString("city", "");
		weChatUserInfo.country = mainJsonObject.optString("country", "");
		weChatUserInfo.headimgurl = mainJsonObject.optString("headimgurl", "");
		weChatUserInfo.GroupId = mainJsonObject.optString("GroupId", "");
	}

}
